function IR = cartesianas3(I,rmin,rmax)
 [F C] = size(I);
 IR = zeros(F, C);
 Om = (F+1)/2;                  % co-ordinates of the center of the image
 On = (C+1)/2;
 sx = (F-1)/2;                  % scale factors
 sy = (C-1)/2;
 delR = 1/(F-1);
 delT = 2*pi/C;
for xi = 1:F
for yi = 1:C
    D=((F/2-xi)^2 + (C/2-yi)^2)^0.5;
    if(D<=rmax && D>rmin)
      x = (xi - Om)/sx;
      y = (yi - On)/sy;
      radio = sqrt(x^2 + y^2);
      if radio >=0 && radio <=1
         theta = atan2(y,x);
         if theta < 0
            theta = theta + 2*pi;
         end
         l1 = ceil(1 + (radio)/delR);
         l2 = ceil(1 + theta/delT); 
         tf = floor(1 + theta/delT);
         if l1 > F
            l1 = tf;
         end
       
         if l2 > C
            l2 = tf;
         end
       %IR (xi, yi) = I (l1, l2);
       IR (l1, l2) = 1;
       
       
       
       
      end
    end
end
end